<?php

namespace Apps\Common\Models;

/**
 * 美容院V2.0扩展属性Model
 * @author     chenxiaolin
 * @date        2016年1月19日
 * @version     2.0.0
 * @copyright   Copyright 2016 meelier.com
 */
class BeautyParlorAttr extends \PhalconPlus\Database\Model
{
    /**
     * 
     * @var integer
     */
    public $attr_id;

    public $beauty_parlor_id;
    
    public $open_year;
    
    public $shop_area;
    
    public $service_num;
    
    /**
     * @var DateTime
     */
    public $open_time;
    
    public $close_time;
    
    /**
     * 
     * @var decimal
     */
    public $low_price;
    
    /**
     * @var string
     */
    public $facilities;
    
    /**
     * Initialize method for model.
     */
    public function initialize()
    {
        $this->hasOne('beauty_parlor_id', 'Apps\Common\Models\BeautyParlor', 'bp_id', array('alias' => 'BeautyParlor'));
    }
    
    /**
     * Returns table name mapped in the model.
     *
     * @return string
     */
    public function getSource()
    {
        return 'beauty_parlor_attr';
    }

    /**
     * Allows to query a set of records that match the specified conditions
     *
     * @param mixed $parameters
     * @return BeautyParlorAttr[]
     */
    public static function find($parameters = null)
    {
        return parent::find($parameters);
    }

    /**
     * Allows to query the first record that match the specified conditions
     *
     * @param mixed $parameters
     * @return BeautyParlorAttr
     */
    public static function findFirst($parameters = null)
    {
        return parent::findFirst($parameters);
    }
    
    /**
     * Independent Column Mapping.
     * Keys are the real names in the table and the values their names in the application
     *
     * @return array
     */
    public function columnMap()
    {
        return array(
            'attr_id' => 'attr_id',
            'beauty_parlor_id' => 'beauty_parlor_id',
            'open_time' => 'open_time',
            'close_time' => 'close_time',
            'low_price' => 'low_price',
            'open_year' => 'open_year',
            'shop_area' => 'shop_area',
            'service_num' => 'service_num',
            'facilities' => 'facilities'
        );
    }
}
?>